package io.renren.modules.app.controller;

import java.util.Arrays;
import java.util.Map;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.app.service.SettleInService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.zheok.testing.entity.SettleInEntity;




/**
 * 商户入驻表
 *
 * @author ææ¢
 * @email 2863751700@qq.com
 * @date 2022-07-31 19:08:33
 */
@RestController
@RequestMapping("testing/settlein")
public class SettleInController {
    @Autowired
    private SettleInService settleInService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    // //@RequiresPermissions("testing:settlein:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = settleInService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    // //@RequiresPermissions("testing:settlein:info")
    public R info(@PathVariable("id") Long id){
		SettleInEntity settleIn = settleInService.getById(id);

        return R.ok().put("settleIn", settleIn);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    // //@RequiresPermissions("testing:settlein:save")
    public R save(@RequestBody SettleInEntity settleIn){
		settleInService.save(settleIn);

        return R.ok();
    }
    /**
     * 保存
     */
    @PostMapping("/examine")
    // //@RequiresPermissions("testing:settlein:save")
    public R examine(@RequestBody SettleInEntity settleIn){
        settleInService.examine(settleIn);

        return R.ok();
    }
    /**
     * 修改
     */
    @RequestMapping("/update")
    // //@RequiresPermissions("testing:settlein:update")
    public R update(@RequestBody SettleInEntity settleIn){
		settleInService.updateById(settleIn);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    // //@RequiresPermissions("testing:settlein:delete")
    public R delete(@RequestBody Long[] ids){
		settleInService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
